var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');

var app = express();

app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use("/admin", express.static(path.join(__dirname, './public/admin'))); //通过/admin访问后台
app.use("/upload", express.static(path.join(__dirname, './public/upload')));
app.use("/", express.static(path.join(__dirname, './public/www'))); //通过/访问前台

//曾浩南/登陆
app.use("/api/User", require("./routes/User"));

//院线 作者：舒利霞
app.use("/api/Cinema", require("./routes/Cinema"));

//简帮松
app.use("/api/Article", require("./routes/Article"));

//吴佩雄
app.use("/api/Movie", require("./routes/Movie"));

//吴佩雄
app.use("/api/upload", require("./routes/upload"));
//jing
app.use("/api/MovieAndCinema", require("./routes/MovieAndCinema"));
module.exports = app;
